﻿using HandyControl.Controls;
using HandyControl.Data;

namespace FunasrSTT.Translate.Services;

/// <summary>
/// 消息管理器.
/// </summary>
public class MessageManager
{
    /// <summary>
    /// 成功.
    /// </summary>
    /// <param name="message">消息.</param>
    public static void Success(string message)
    {
        Growl.Success(new()
        {
            Message  = message,
            WaitTime = 3,
            Type     = InfoType.Success,
        });
    }

    /// <summary>
    /// 信息.
    /// </summary>
    /// <param name="message">消息.</param>
    public static void Info(string message)
    {
        Growl.Info(new()
        {
            Message  = message,
            WaitTime = 3,
            Type     = InfoType.Info,
        });
    }

    /// <summary>
    /// 错误.
    /// </summary>
    /// <param name="message">消息.</param>
    public static void Error(string message)
    {
        Growl.Error(new()
        {
            Message  = message,
            WaitTime = 3,
            Type     = InfoType.Error,
        });
    }

    /// <summary>
    /// 警告.
    /// </summary>
    /// <param name="message">消息.</param>
    public static void Warning(string message)
    {
        Growl.Warning(new()
        {
            Message  = message,
            WaitTime = 3,
            Type     = InfoType.Warning,
        });
    }

    /// <summary>
    /// 全局成功.
    /// </summary>
    /// <param name="message">消息.</param>
    public static void SuccessGlobal(string message)
    {
        Growl.SuccessGlobal(new GrowlInfo
        {
            Message  = message,
            WaitTime = 3,
            Type     = InfoType.Success,
        });
    }

    /// <summary>
    /// 全局信息.
    /// </summary>
    /// <param name="message">消息.</param>
    public static void InfoGlobal(string message)
    {
        Growl.InfoGlobal(new GrowlInfo
        {
            Message  = message,
            WaitTime = 3,
            Type     = InfoType.Info,
        });
    }

    /// <summary>
    /// 全局错误.
    /// </summary>
    /// <param name="message">消息.</param>
    public static void ErrorGlobal(string message)
    {
        Growl.ErrorGlobal(new GrowlInfo
        {
            Message  = message,
            WaitTime = 3,
            Type     = InfoType.Error,
        });
    }

    /// <summary>
    /// 全局警告.
    /// </summary>
    /// <param name="message">消息.</param>
    public static void WarningGlobal(string message)
    {
        Growl.WarningGlobal(new GrowlInfo
        {
            Message  = message,
            WaitTime = 3,
            Type     = InfoType.Warning,
        });
    }
}